/*
 * Copyright 2021 Shulie Technology, Co.Ltd
 * Email: shulie@shulie.io
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.shulie.tro.cloud.open.entrypoint.convert;

import com.alibaba.fastjson.JSON;
import io.shulie.tro.cloud.biz.input.scenemanage.SceneSlaRefInput;
import io.shulie.tro.cloud.open.req.scenemanage.SceneSlaRefOpen;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

import static org.mapstruct.factory.Mappers.*;


/**
 * @Author: mubai
 * @Date: 2020-10-29 10:56
 * @Description:
 */

public class SceneSlaRefInputConverter {


    public static SceneSlaRefInput of(SceneSlaRefOpen sceneSlaRef) {
        SceneSlaRefInput out = new SceneSlaRefInput();
        BeanUtils.copyProperties(sceneSlaRef,out);
        return out;
    }

    public static List<SceneSlaRefInput> ofList(List<SceneSlaRefOpen> sceneSlaRefs) {
        List<SceneSlaRefInput> result = new ArrayList<>();
        sceneSlaRefs.stream().forEach(sceneSlaRef -> {
            result.add(of(sceneSlaRef));
        });
        return result;
    }


}
